#ifndef I2C_INTERFACE_H_
#define I2C_INTERFACE_H_

#include <stdint.h>

#define PATH_I2C    "/dev/i2c7"
#define max2008x_pullup_addr	0x29   //96706
#define max2008x_pulldown_addr	 0x28  //9286
#define i2c_speed	400000
#define max2008x_configreg	0x01

typedef struct I2C_Config_st{
	int i2c_fd;
	int slaveaddr_fmt;
	int slaveaddr;
	int stop_bytes;
	unsigned int speed;
}I2C_Config_st;

int I2C_Open(const char* i2c_addr);
int I2C_Config(I2C_Config_st* i2c_dev,int i2c_fd,int slaveaddr,int slaveaddr_fmt);
int I2C_Write(I2C_Config_st i2c_dev,uint8_t* cmd,int cmd_len,uint8_t* dat,int dat_len);
int I2C_Read(I2C_Config_st i2c_dev,uint8_t* reg,int reg_len,uint8_t* dat,int dat_len);
int I2C_SetSpeed(I2C_Config_st* i2c_dev,unsigned int speed);
int I2C_Close(int);

int max9286_power(int channel_num, int state_);
int max96706_power(int channel_num, int state_);

#endif /* I2C_INTERFACE_H_ */
